package com.kethink;

import java.util.HashSet;
import java.util.Set;

/**
 * @Description create by xuxiaojun
 * date: 2018/12/25
 * Time: 15:14
 */
public class LeeCode_804 {

    public static void main(String[] args){
        System.out.println(mosi());
    }

    public static int mosi(){
        String[] base = {".-","-...","-.-.","-..",".","..-.","--.","....","..",".---","-.-",".-..","--","-.","---",".--.","--.-",".-.","...","-","..-","...-",".--","-..-","-.--","--.."};
        String[] words = {"gin", "zen", "gig", "msg"};
//		String[] words = {"rwjje","aittjje","auyyn","lqtktn","lmjwn"};
        String[] charToStringS = new String[words.length];
        int x = 0 ;
        if(words.length == 0){
            return 0;
        }else if (words.length == 1){
            return 1;
        }else{
            for (int i = 0 ; i < words.length ; i++){
                String str = words[i];
                charToStringS[i] = "";
                char[] chars = str.toCharArray();
                for(int j = 0 ; j < chars.length ; j++){
                    char c = chars[j];
                    int k = c - 'a';
                    charToStringS[i] += base[k];
                }
                System.out.print(str+"->");
                System.out.println(charToStringS[i]);
            }
        }

        String[] result = {};
        Set<String> set = new HashSet<>() ;
        for(int i = 0 ; i < charToStringS.length; i++){
            set.add(charToStringS[i]) ;
        }

        return set.size();
    }
}
